import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

// 静态路由
const home = (resolve) => require(['@/pages/home.vue'], resolve)
const project = (resolve) => require(['@/pages/project.vue'], resolve)
const project_details = (resolve) => require(['@/pages/project-details.vue'], resolve)
const search = (resolve) => require(['@/pages/search.vue'], resolve)
const constRouter = [
	{
		path: '/home',
		name: '主页',
		component: home,
		hidden: true,
		children:[
			{
				path: '/project',
				name: '项目列表',
				component: project ,
				hidden: false ,
				meta:[
					{"name":"项目","path":""}
				]
			},
			{
				path: '/project-details/:id',
				name: '项目信息',
				component: project_details ,
				hidden: false ,
				meta:[
					{"name":"项目","path":"/project"}
				]
			},
			{
				path: '/search',
				name: '查询',
				component: search ,
				hidden: false ,
				meta:[
					{"name":"查询","path":""}
				]
			}
		]
	}
]


const router = new VueRouter({
	mode: 'history',
    routes: constRouter 
})


export default router